package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: ControllerService
 * @Date: Created in 10:42 2020/12/22
 * @Description:
 */

@Service
@Slf4j
public class ControllerService extends BaseService {

     /**
      * @Author YangYu
      * @Description 控制器分页列表
      * @Date Created in 11:05 2020/12/22
      * @Param [jsonParam]
      */

     public RespEntity controllerPagList(JSONObject jsonParam) {
          //处理支持form-data和json两种方式
          jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
          return restJava(jsonParam,"basisInfo","controllerPagList","controller");
     }

     /**
      * @Author YangYu
      * @Description 控制器详情
      * @Date Created in 15:27 2020/12/30
      * @Param [jsonParam]
      */

     public RespEntity detail(JSONObject jsonParam){
          //处理支持form-data和json两种方式
          jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
          return restJava(jsonParam,"basisInfo","detail","controller");
     }
     /**
      * @Author YangYu
      * @Description 控制器新增
      * @Date Created in 10:12 2020/12/24
      * @Param [jsonParam]
      */

     public RespEntity add(JSONObject jsonParam){
          //处理支持form-data和json两种方式
          jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
          return restJava(jsonParam,"basisInfo","add","controller");
     }

     /**
      * @Author YangYu
      * @Description 控制器更新
      * @Date Created in 10:13 2020/12/24
      * @Param [jsonParam]
      */

     public RespEntity update(JSONObject jsonParam){
          //处理支持form-data和json两种方式
          jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
          return restJava(jsonParam,"basisInfo","update","controller");
     }

     /**
      * @Author YangYu
      * @Description 控制器删除
      * @Date Created in 10:26 2020/12/24
      * @Param [jsonParam]
      */

     public RespEntity delete(JSONObject jsonParam){
          //处理支持form-data和json两种方式
          jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
          return restJava(jsonParam,"basisInfo","delete","controller");
     }

     /**
      * @Author YangYu
      * @Description 控制器不分页列表
      * @Date Created in 15:00 2021/1/6
      * @Param [jsonParam]
      */

     public RespEntity controllerList(JSONObject jsonParam) {
          //处理支持form-data和json两种方式
          jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
          return restJava(jsonParam, "basisInfo", "controllerList", "controller");
     }
}
